{% extends 'dashboard/dash_base.html' %}

{% block title %}阅读设置{{- ' - ' -}}{{- Setting.get_setting('blogtitle', 'Plog') -}}{% endblock %}
{% block body_class %}dashboard-setting dashboard-setting-reading{% endblock %}

{% block page_headtitle %}
<div class="page-title">
    <div class="title-env">
        <h1 class="title">阅读设置</h1>
        <p class="description">网站内容阅读相关选项</p>
    </div>
    <div class="breadcrumb-env">
        <ol class="breadcrumb">
            <li>
                <a href="{{ url_for('dashboard.dashboard_home') }}">
                    <span class="glyphicon glyphicon-home"></span>控制板
                </a>
            </li>
            <li>
                <a href="{{ url_for('dashboard.settings') }}">设置</a>
            </li>
            <li>
                <a href="{{ url_for('dashboard.reading_setting') }}">阅读设置</a>
            </li>
        </ol>
    </div>
    <div class="clearfix"></div>
</div>
{% endblock %}

{% block page_content %}
<section class="content">
    <form id="setting-reading" class="" method="post">
        {{ form.hidden_tag() }}
        <div class="form-group">
            <label>博客首页大幻灯</label>
            <img class="blog-big-banner" alt="big_banner" role="button" src="{{ Setting.get_setting('big_banner') or 'http://images.huxiu.com/article/cover/201602/16/080449809182.jpg?imageView2/1/w/1600/h/900/imageMogr2/strip/interlace/1/format/jpg' }}">
            <input id="blog-big-banner" name="reading[big_banner]" type="hidden" value="{{ Setting.get_setting('big_banner') or 'http://images.huxiu.com/article/cover/201602/16/080449809182.jpg?imageView2/1/w/1600/h/900/imageMogr2/strip/interlace/1/format/jpg' }}">
            <p class="help-block">博客首页顶部大幻灯图片</p>
        </div>
        <div class="form-group">
            <label for="big-banner-title">大幻灯标题</label>
            <input id="big-banner-title" name="reading[big_banner_title]" type="text" class="text-input ember-view form-control" value="{{ Setting.get_setting('big_banner_title') }}">
            <p class="help-block">设置大幻灯的标题</p>
        </div>
        <div class="form-group">
            <label for="big-banner-link">大幻灯链接</label>
            <input id="big-banner-link" name="reading[big_banner_link]" type="text" class="text-input ember-view form-control" value="{{ Setting.get_setting('big_banner_link') }}">
            <p class="help-block">设置大幻灯的链接</p>
        </div>

        <div class="form-group">
            <label>博客首页小幻灯1</label>
            <img class="blog-tiny-banner1" alt="tiny_banner1" role="button" src="{{ Setting.get_setting('tiny_banner1') or 'http://images.huxiu.com/article/cover/201602/16/080449809182.jpg?imageView2/1/w/1600/h/900/imageMogr2/strip/interlace/1/format/jpg' }}">
            <input id="blog-tiny-banner1" name="reading[tiny_banner1]" type="hidden" value="{{ Setting.get_setting('tiny_banner1') or 'http://images.huxiu.com/article/cover/201602/16/080449809182.jpg?imageView2/1/w/1600/h/900/imageMogr2/strip/interlace/1/format/jpg' }}">
            <p class="help-block">博客首页顶部小幻灯1图片</p>
        </div>
        <div class="form-group">
            <label for="tiny-banner1-title">小幻灯1标题</label>
            <input id="tiny-banner1-title" name="reading[tiny_banner1_title]" type="text" class="text-input ember-view form-control" value="{{ Setting.get_setting('tiny_banner1_title') }}">
            <p class="help-block">设置小幻灯1的标题</p>
        </div>
        <div class="form-group">
            <label for="tiny-banner1-link">小幻灯1链接</label>
            <input id="tiny-banner1-link" name="reading[tiny_banner1_link]" type="text" class="text-input ember-view form-control" value="{{ Setting.get_setting('tiny_banner1_link') }}">
            <p class="help-block">设置小幻灯1的链接</p>
        </div>

        <div class="form-group">
            <label>博客首页小幻灯2</label>
            <img class="blog-tiny-banner2" alt="tiny_banner2" role="button" src="{{ Setting.get_setting('tiny_banner2') or 'http://images.huxiu.com/article/cover/201602/16/080449809182.jpg?imageView2/1/w/1600/h/900/imageMogr2/strip/interlace/1/format/jpg' }}">
            <input id="blog-tiny-banner2" name="reading[tiny_banner2]" type="hidden" value="{{ Setting.get_setting('tiny_banner2') or 'http://images.huxiu.com/article/cover/201602/16/080449809182.jpg?imageView2/1/w/1600/h/900/imageMogr2/strip/interlace/1/format/jpg' }}">
            <p class="help-block">博客首页顶部小幻灯1图片</p>
        </div>
        <div class="form-group">
            <label for="tiny-banner2-title">小幻灯2标题</label>
            <input id="tiny-banner2-title" name="reading[tiny_banner2_title]" type="text" class="text-input ember-view form-control" value="{{ Setting.get_setting('tiny_banner2_title') }}">
            <p class="help-block">设置小幻灯2的标题</p>
        </div>
        <div class="form-group">
            <label for="tiny-banner2-link">小幻灯2链接</label>
            <input id="tiny-banner2-link" name="reading[tiny_banner2_link]" type="text" class="text-input ember-view form-control" value="{{ Setting.get_setting('tiny_banner2_link') }}">
            <p class="help-block">设置小幻灯2的链接</p>
        </div>

        <fieldset>
            <div class="form-group">
                <label for="posts-per-page">每页显示博文数</label>
                <input id="posts-per-page" name="reading[posts_per_page]" type="number" pattern="[0-9]*" class="num-input ember-view form-control" value="{{ Setting.get_setting('posts_per_page', 10) }}">
                <p class="help-block">设置每页显示博文的数量</p>
            </div>
            <div class="form-group">
                <label for="excerpt-length">文章摘要长度</label>
                <input id="excerpt-length" name="reading[excerpt_length]" type="number" pattern="[0-9]*" class="num-input ember-view form-control" value="{{ Setting.get_setting('excerpt_length', 120) }}">
                <p class="help-block">设置列表页文章摘要的长度</p>
            </div>
        </fieldset>
        <div class="submit-btn-env">
            {{ form.submit(class="btn btn-info", value="保存") }}
        </div>
    </form>
</section>
{% endblock %}